home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / PowerPC / Dev / PPCRelease / include / powerup / ppcinline / macros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-28  |  34.6 KB  |  1,038 lines

  1. #ifndef __INLINE_MACROS_H
  2. #define __INLINE_MACROS_H
  3.  
  4. #include <powerup/gcclib/powerup_protos.h>
  5.  
  6. /* Use these macros to calculate cache flush start address and cache flush
  7. length. */
  8. #define __CACHE_START(start) ((void *) ((unsigned long int) (start) & ~31))
  9. #define __CACHE_LENGTH(start,length) ((((length) + (unsigned long int) (start) + 31) & ~31) - ((unsigned long int) (start) & ~31))
  10.  
  11. /*
  12.    General macros for Amiga function calls. Not all the possibilities have
  13.    been created - only the ones which exist in OS 3.1. Third party libraries
  14.    and future versions of AmigaOS will maybe need some new ones...
  15.  
  16.    LPX - functions that take X arguments.
  17.  
  18.    Modifiers (variations are possible):
  19.    NR - no return (void),
  20.    A4, A5 - "a4" or "a5" is used as one of the arguments,
  21.    UB - base will be given explicitly by user (see cia.resource).
  22.    FP - one of the parameters has type "pointer to function".
  23.  
  24.    "bt" arguments are not used - they are provided for backward compatibility
  25.    only.
  26.    Actually..the "bt" parameter is needed because otherwise the macro doesn`t
  27.    work for some reason i don`t know gcc puts an empty argument at the position
  28.    before the argument bn and without the placeholder "bt".
  29.    I think it has something to do with #define *_BASE_NAME
  30.  
  31.    the (cm1==IF_CACHEFLUSHAREA) conditional is optimized away
  32. */
  33.  
  34. #ifndef __INLINE_STUB_H
  35. #include <powerup/ppcinline/stubs.h>
  36. #endif
  37.  
  38. #ifndef POWERUP_PPCLIB_INTERFACE_H
  39. #include <powerup/ppclib/interface.h>
  40. #endif
  41.  
  42. #define LP0(offs, rt, name, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  43. ({                                \
  44.    struct Caos MyCaos;                        \
  45.    {                                \
  46.       rt _##name##_re;                        \
  47.       MyCaos.a6        = (ULONG) bn;            \
  48.       MyCaos.M68kCacheMode    =    cm1;            \
  49.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  50.       {                                \
  51.         MyCaos.M68kStart    =    cs1;            \
  52.         MyCaos.M68kLength    =    cl1;            \
  53.       }                                \
  54.       MyCaos.PPCCacheMode    =    cm2;            \
  55.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  56.       {                                \
  57.         MyCaos.PPCStart    =    cs2;            \
  58.         MyCaos.PPCLength    =    cl2;            \
  59.       }                                \
  60.       MyCaos.caos_Un.Offset    =    (-offs);        \
  61.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  62.       _##name##_re;                        \
  63.    }                                \
  64. })
  65.  
  66. #define LP0NR(offs, name, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  67. ({                                \
  68.    struct Caos MyCaos;                        \
  69.    {                                \
  70.       MyCaos.a6        = (ULONG) bn;            \
  71.       MyCaos.M68kCacheMode    =    cm1;            \
  72.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  73.       {                                \
  74.         MyCaos.M68kStart    =    cs1;            \
  75.         MyCaos.M68kLength    =    cl1;            \
  76.       }                                \
  77.       MyCaos.PPCCacheMode    =    cm2;            \
  78.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  79.       {                                \
  80.         MyCaos.PPCStart    =    cs2;            \
  81.         MyCaos.PPCLength    =    cl2;            \
  82.       }                                \
  83.       MyCaos.caos_Un.Offset    =    (-offs);        \
  84.       PPCCallOS(&MyCaos);                    \
  85.    }                                \
  86. })
  87.  
  88. #define LP1(offs, rt, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  89. ({                                \
  90.    struct Caos MyCaos;                        \
  91.    {                                \
  92.       rt _##name##_re;                        \
  93.       MyCaos.##r1        = (ULONG) v1;            \
  94.       MyCaos.a6        = (ULONG) bn;            \
  95.       MyCaos.M68kCacheMode    =    cm1;            \
  96.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  97.       {                                \
  98.         MyCaos.M68kStart    =    cs1;            \
  99.         MyCaos.M68kLength    =    cl1;            \
  100.       }                                \
  101.       MyCaos.PPCCacheMode    =    cm2;            \
  102.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  103.       {                                \
  104.         MyCaos.PPCStart    =    cs2;            \
  105.         MyCaos.PPCLength    =    cl2;            \
  106.       }                                \
  107.       MyCaos.caos_Un.Offset    =    (-offs);        \
  108.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  109.       _##name##_re;                        \
  110.    }                                \
  111. })
  112.  
  113. #define LP1NR(offs, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  114. ({                                \
  115.    struct Caos MyCaos;                        \
  116.    {                                \
  117.       MyCaos.##r1        = (ULONG) v1;            \
  118.       MyCaos.a6        = (ULONG) bn;            \
  119.       MyCaos.M68kCacheMode    =    cm1;            \
  120.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  121.       {                                \
  122.         MyCaos.M68kStart    =    cs1;            \
  123.         MyCaos.M68kLength    =    cl1;            \
  124.       }                                \
  125.       MyCaos.PPCCacheMode    =    cm2;            \
  126.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  127.       {                                \
  128.         MyCaos.PPCStart    =    cs2;            \
  129.         MyCaos.PPCLength    =    cl2;            \
  130.       }                                \
  131.       MyCaos.caos_Un.Offset    =    (-offs);        \
  132.       PPCCallOS(&MyCaos);                    \
  133.    }                                \
  134. })
  135.  
  136. /* Only graphics.library/AttemptLockLayerRom() */
  137. #define LP1A5(offs, rt, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  138. ({                                \
  139.    struct Caos MyCaos;                        \
  140.    {                                \
  141.       rt _##name##_re;                        \
  142.       MyCaos.##r1        = (ULONG) v1;            \
  143.       MyCaos.a6        = (ULONG) bn;            \
  144.       MyCaos.M68kCacheMode    =    cm1;            \
  145.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  146.       {                                \
  147.         MyCaos.M68kStart    =    cs1;            \
  148.         MyCaos.M68kLength    =    cl1;            \
  149.       }                                \
  150.       MyCaos.PPCCacheMode    =    cm2;            \
  151.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  152.       {                                \
  153.         MyCaos.PPCStart    =    cs2;            \
  154.         MyCaos.PPCLength    =    cl2;            \
  155.       }                                \
  156.       MyCaos.caos_Un.Offset    =    (-offs);        \
  157.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  158.       _##name##_re;                        \
  159.    }                                \
  160. })
  161.  
  162. /* Only graphics.library/LockLayerRom() and graphics.library/UnlockLayerRom() */
  163. #define LP1NRA5(offs, name, t1, v1, r1, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  164. ({                                \
  165.    struct Caos MyCaos;                        \
  166.    {                                \
  167.       MyCaos.##r1        = (ULONG) v1;            \
  168.       MyCaos.a6        = (ULONG) bn;            \
  169.       MyCaos.M68kCacheMode    =    cm1;            \
  170.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  171.       {                                \
  172.         MyCaos.M68kStart    =    cs1;            \
  173.         MyCaos.M68kLength    =    cl1;            \
  174.       }                                \
  175.       MyCaos.PPCCacheMode    =    cm2;            \
  176.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  177.       {                                \
  178.         MyCaos.PPCStart    =    cs2;            \
  179.         MyCaos.PPCLength    =    cl2;            \
  180.       }                                \
  181.       MyCaos.caos_Un.Offset    =    (-offs);        \
  182.       PPCCallOS(&MyCaos);                    \
  183.    }                                \
  184. })
  185.  
  186. /* Only exec.library/Supervisor() */
  187. #define LP1A5FP(offs, rt, name, t1, v1, r1, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  188. ({                                \
  189.    typedef fpt;                            \
  190.    struct Caos MyCaos;                        \
  191.    {                                \
  192.       rt _##name##_re;                        \
  193.       MyCaos.##r1        = (ULONG) v1;            \
  194.       MyCaos.a6        = (ULONG) bn;            \
  195.       MyCaos.M68kCacheMode    =    cm1;            \
  196.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  197.       {                                \
  198.         MyCaos.M68kStart    =    cs1;            \
  199.         MyCaos.M68kLength    =    cl1;            \
  200.       }                                \
  201.       MyCaos.PPCCacheMode    =    cm2;            \
  202.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  203.       {                                \
  204.         MyCaos.PPCStart    =    cs2;            \
  205.         MyCaos.PPCLength    =    cl2;            \
  206.       }                                \
  207.       MyCaos.caos_Un.Offset    =    (-offs);        \
  208.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  209.       _##name##_re;                        \
  210.    }                                \
  211. })
  212.  
  213.  
  214. #define LP2(offs, rt, name, t1, v1, r1, t2, v2, r2, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  215. ({                                \
  216.    struct Caos MyCaos;                        \
  217.    {                                \
  218.       rt _##name##_re;                        \
  219.       MyCaos.##r1        = (ULONG) v1;            \
  220.       MyCaos.##r2        = (ULONG) v2;            \
  221.       MyCaos.a6        = (ULONG) bn;            \
  222.       MyCaos.M68kCacheMode    =    cm1;            \
  223.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  224.       {                                \
  225.         MyCaos.M68kStart    =    cs1;            \
  226.         MyCaos.M68kLength    =    cl1;            \
  227.       }                                \
  228.       MyCaos.PPCCacheMode    =    cm2;            \
  229.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  230.       {                                \
  231.         MyCaos.PPCStart    =    cs2;            \
  232.         MyCaos.PPCLength    =    cl2;            \
  233.       }                                \
  234.       MyCaos.caos_Un.Offset    =    (-offs);        \
  235.       _##name##_re = (rt) PPCCallOS(&MyCaos);                      \
  236.       _##name##_re;                        \
  237.    }                                \
  238. })
  239.  
  240. #define LP2NR(offs, name, t1, v1, r1, t2, v2, r2, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  241. ({                                \
  242.    struct Caos MyCaos;                        \
  243.    {                                \
  244.       MyCaos.##r1        = (ULONG) v1;            \
  245.       MyCaos.##r2        = (ULONG) v2;            \
  246.       MyCaos.a6        = (ULONG) bn;            \
  247.       MyCaos.M68kCacheMode    =    cm1;            \
  248.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  249.       {                                \
  250.         MyCaos.M68kStart    =    cs1;            \
  251.         MyCaos.M68kLength    =    cl1;            \
  252.       }                                \
  253.       MyCaos.PPCCacheMode    =    cm2;            \
  254.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  255.       {                                \
  256.         MyCaos.PPCStart    =    cs2;            \
  257.         MyCaos.PPCLength    =    cl2;            \
  258.       }                                \
  259.       MyCaos.caos_Un.Offset    =    (-offs);        \
  260.       PPCCallOS(&MyCaos);                    \
  261.    }                                \
  262. })
  263.  
  264. /* Only cia.resource/AbleICR() and cia.resource/SetICR() */
  265. #define LP2UB(offs, rt, name, t1, v1, r1, t2, v2, r2, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  266. ({                                \
  267.    struct Caos MyCaos;                        \
  268.    {                                \
  269.       rt _##name##_re;                        \
  270.       MyCaos.##r1        = (ULONG) v1;            \
  271.       MyCaos.##r2        = (ULONG) v2;            \
  272.       MyCaos.M68kCacheMode    =    cm1;            \
  273.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  274.       {                                \
  275.         MyCaos.M68kStart    =    cs1;            \
  276.         MyCaos.M68kLength    =    cl1;            \
  277.       }                                \
  278.       MyCaos.PPCCacheMode    =    cm2;            \
  279.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  280.       {                                \
  281.         MyCaos.PPCStart    =    cs2;            \
  282.         MyCaos.PPCLength    =    cl2;            \
  283.       }                                \
  284.       MyCaos.caos_Un.Offset    =    (-offs);        \
  285.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  286.       _##name##_re;                        \
  287.    }                                \
  288. })
  289.  
  290. /* Only dos.library/InternalUnLoadSeg() */
  291. #define LP2FP(offs, rt, name, t1, v1, r1, t2, v2, r2, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  292. ({                                \
  293.    typedef fpt;                            \
  294.    struct Caos MyCaos;                        \
  295.    {                                \
  296.       rt _##name##_re;                        \
  297.       MyCaos.##r1        = (ULONG) v1;            \
  298.       MyCaos.##r2        = (ULONG) v2;            \
  299.       MyCaos.a6        = (ULONG) bn;            \
  300.       MyCaos.M68kCacheMode    =    cm1;            \
  301.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  302.       {                                \
  303.         MyCaos.M68kStart    =    cs1;            \
  304.         MyCaos.M68kLength    =    cl1;            \
  305.       }                                \
  306.       MyCaos.PPCCacheMode    =    cm2;            \
  307.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  308.       {                                \
  309.         MyCaos.PPCStart    =    cs2;            \
  310.         MyCaos.PPCLength    =    cl2;            \
  311.       }                                \
  312.       MyCaos.caos_Un.Offset    =    (-offs);        \
  313.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  314.       _##name##_re;                        \
  315.    }                                \
  316. })
  317.  
  318. #define LP3(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  319. ({                                \
  320.    struct Caos MyCaos;                        \
  321.    {                                \
  322.       rt _##name##_re;                        \
  323.       MyCaos.##r1        = (ULONG) v1;            \
  324.       MyCaos.##r2        = (ULONG) v2;            \
  325.       MyCaos.##r3        = (ULONG) v3;            \
  326.       MyCaos.a6        = (ULONG) bn;            \
  327.       MyCaos.M68kCacheMode    =    cm1;            \
  328.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  329.       {                                \
  330.         MyCaos.M68kStart    =    cs1;            \
  331.         MyCaos.M68kLength    =    cl1;            \
  332.       }                                \
  333.       MyCaos.PPCCacheMode    =    cm2;            \
  334.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  335.       {                                \
  336.         MyCaos.PPCStart    =    cs2;            \
  337.         MyCaos.PPCLength    =    cl2;            \
  338.       }                                \
  339.       MyCaos.caos_Un.Offset    =    (-offs);        \
  340.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  341.       _##name##_re;                        \
  342.    }                                \
  343. })
  344.  
  345. #define LP3NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  346. ({                                \
  347.    struct Caos MyCaos;                        \
  348.    {                                \
  349.       MyCaos.##r1        = (ULONG) v1;            \
  350.       MyCaos.##r2        = (ULONG) v2;            \
  351.       MyCaos.##r3        = (ULONG) v3;            \
  352.       MyCaos.a6        = (ULONG) bn;            \
  353.       MyCaos.M68kCacheMode    =    cm1;            \
  354.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  355.       {                                \
  356.         MyCaos.M68kStart    =    cs1;            \
  357.         MyCaos.M68kLength    =    cl1;            \
  358.       }                                \
  359.       MyCaos.PPCCacheMode    =    cm2;            \
  360.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  361.       {                                \
  362.         MyCaos.PPCStart    =    cs2;            \
  363.         MyCaos.PPCLength    =    cl2;            \
  364.       }                                \
  365.       MyCaos.caos_Un.Offset    =    (-offs);        \
  366.       PPCCallOS(&MyCaos);                    \
  367.    }                                \
  368. })
  369.  
  370. /* Only cia.resource/AddICRVector() */
  371. #define LP3UB(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  372. ({                                \
  373.    struct Caos MyCaos;                        \
  374.    {                                \
  375.       rt _##name##_re;                        \
  376.       MyCaos.##r1        = (ULONG) v1;            \
  377.       MyCaos.##r2        = (ULONG) v2;            \
  378.       MyCaos.##r3        = (ULONG) v3;            \
  379.       MyCaos.M68kCacheMode    =    cm1;            \
  380.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  381.       {                                \
  382.         MyCaos.M68kStart    =    cs1;            \
  383.         MyCaos.M68kLength    =    cl1;            \
  384.       }                                \
  385.       MyCaos.PPCCacheMode    =    cm2;            \
  386.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  387.       {                                \
  388.         MyCaos.PPCStart    =    cs2;            \
  389.         MyCaos.PPCLength    =    cl2;            \
  390.       }                                \
  391.       MyCaos.caos_Un.Offset    =    (-offs);        \
  392.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  393.       _##name##_re;                        \
  394.    }                                \
  395. })
  396.  
  397. /* Only cia.resource/RemICRVector() */
  398. #define LP3NRUB(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  399. ({                                \
  400.    struct Caos MyCaos;                        \
  401.    {                                \
  402.       MyCaos.##r1        = (ULONG) v1;            \
  403.       MyCaos.##r2        = (ULONG) v2;            \
  404.       MyCaos.##r3        = (ULONG) v3;            \
  405.       MyCaos.M68kCacheMode    =    cm1;            \
  406.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  407.       {                                \
  408.         MyCaos.M68kStart    =    cs1;            \
  409.         MyCaos.M68kLength    =    cl1;            \
  410.       }                                \
  411.       MyCaos.PPCCacheMode    =    cm2;            \
  412.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  413.       {                                \
  414.         MyCaos.PPCStart    =    cs2;            \
  415.         MyCaos.PPCLength    =    cl2;            \
  416.       }                                \
  417.       MyCaos.caos_Un.Offset    =    (-offs);        \
  418.       PPCCallOS(&MyCaos);                    \
  419.    }                                \
  420. })
  421.  
  422. /* Only exec.library/SetFunction() */
  423. #define LP3FP(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  424. ({                                \
  425.    typedef fpt;                            \
  426.    struct Caos MyCaos;                        \
  427.    {                                \
  428.       rt _##name##_re;                        \
  429.       MyCaos.##r1        = (ULONG) v1;            \
  430.       MyCaos.##r2        = (ULONG) v2;            \
  431.       MyCaos.##r3        = (ULONG) v3;            \
  432.       MyCaos.a6        = (ULONG) bn;            \
  433.       MyCaos.M68kCacheMode    =    cm1;            \
  434.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  435.       {                                \
  436.         MyCaos.M68kStart    =    cs1;            \
  437.         MyCaos.M68kLength    =    cl1;            \
  438.       }                                \
  439.       MyCaos.PPCCacheMode    =    cm2;            \
  440.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  441.       {                                \
  442.         MyCaos.PPCStart    =    cs2;            \
  443.         MyCaos.PPCLength    =    cl2;            \
  444.       }                                \
  445.       MyCaos.caos_Un.Offset    =    (-offs);        \
  446.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  447.       _##name##_re;                        \
  448.    }                                \
  449. })
  450.  
  451. /* Only graphics.library/SetCollision() */
  452. #define LP3NRFP(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  453. ({                                \
  454.    typedef fpt;                            \
  455.    struct Caos MyCaos;                        \
  456.    {                                \
  457.       MyCaos.##r1        = (ULONG) v1;            \
  458.       MyCaos.##r2        = (ULONG) v2;            \
  459.       MyCaos.##r3        = (ULONG) v3;            \
  460.       MyCaos.a6        = (ULONG) bn;            \
  461.       MyCaos.M68kCacheMode    =    cm1;            \
  462.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  463.       {                                \
  464.         MyCaos.M68kStart    =    cs1;            \
  465.         MyCaos.M68kLength    =    cl1;            \
  466.       }                                \
  467.       MyCaos.PPCCacheMode    =    cm2;            \
  468.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  469.       {                                \
  470.         MyCaos.PPCStart    =    cs2;            \
  471.         MyCaos.PPCLength    =    cl2;            \
  472.       }                                \
  473.       MyCaos.caos_Un.Offset    =    (-offs);        \
  474.       PPCCallOS(&MyCaos);                    \
  475.    }                                \
  476. })
  477.  
  478. #define LP4(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  479. ({                                \
  480.    struct Caos MyCaos;                        \
  481.    {                                \
  482.       rt _##name##_re;                        \
  483.       MyCaos.##r1        = (ULONG) v1;            \
  484.       MyCaos.##r2        = (ULONG) v2;            \
  485.       MyCaos.##r3        = (ULONG) v3;            \
  486.       MyCaos.##r4        = (ULONG) v4;            \
  487.       MyCaos.a6        = (ULONG) bn;            \
  488.       MyCaos.M68kCacheMode    =    cm1;            \
  489.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  490.       {                                \
  491.         MyCaos.M68kStart    =    cs1;            \
  492.         MyCaos.M68kLength    =    cl1;            \
  493.       }                                \
  494.       MyCaos.PPCCacheMode    =    cm2;            \
  495.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  496.       {                                \
  497.         MyCaos.PPCStart    =    cs2;            \
  498.         MyCaos.PPCLength    =    cl2;            \
  499.       }                                \
  500.       MyCaos.caos_Un.Offset    =    (-offs);        \
  501.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  502.       _##name##_re;                        \
  503.    }                                \
  504. })
  505.  
  506. #define LP4NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  507. ({                                \
  508.    struct Caos MyCaos;                        \
  509.    {                                \
  510.       MyCaos.##r1        = (ULONG) v1;            \
  511.       MyCaos.##r2        = (ULONG) v2;            \
  512.       MyCaos.##r3        = (ULONG) v3;            \
  513.       MyCaos.##r4        = (ULONG) v4;            \
  514.       MyCaos.a6        = (ULONG) bn;            \
  515.       MyCaos.M68kCacheMode    =    cm1;            \
  516.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  517.       {                                \
  518.         MyCaos.M68kStart    =    cs1;            \
  519.         MyCaos.M68kLength    =    cl1;            \
  520.       }                                \
  521.       MyCaos.PPCCacheMode    =    cm2;            \
  522.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  523.       {                                \
  524.         MyCaos.PPCStart    =    cs2;            \
  525.         MyCaos.PPCLength    =    cl2;            \
  526.       }                                \
  527.       MyCaos.caos_Un.Offset    =    (-offs);        \
  528.       PPCCallOS(&MyCaos);                    \
  529.    }                                \
  530. })
  531.  
  532. /* Only exec.library/RawDoFmt() */
  533. #define LP4FP(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  534. ({                                \
  535.    typedef fpt;                            \
  536.    struct Caos MyCaos;                        \
  537.    {                                \
  538.       rt _##name##_re;                        \
  539.       MyCaos.##r1        = (ULONG) v1;            \
  540.       MyCaos.##r2        = (ULONG) v2;            \
  541.       MyCaos.##r3        = (ULONG) v3;            \
  542.       MyCaos.##r4        = (ULONG) v4;            \
  543.       MyCaos.a6        = (ULONG) bn;            \
  544.       MyCaos.M68kCacheMode    =    cm1;            \
  545.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  546.       {                                \
  547.         MyCaos.M68kStart    =    cs1;            \
  548.         MyCaos.M68kLength    =    cl1;            \
  549.       }                                \
  550.       MyCaos.PPCCacheMode    =    cm2;            \
  551.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  552.       {                                \
  553.         MyCaos.PPCStart    =    cs2;            \
  554.         MyCaos.PPCLength    =    cl2;            \
  555.       }                                \
  556.       MyCaos.caos_Un.Offset    =    (-offs);        \
  557.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  558.       _##name##_re;                        \
  559.    }                                \
  560. })
  561.  
  562. #define LP5(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  563. ({                                \
  564.    struct Caos MyCaos;                        \
  565.    {                                \
  566.       rt _##name##_re;                        \
  567.       MyCaos.##r1        = (ULONG) v1;            \
  568.       MyCaos.##r2        = (ULONG) v2;            \
  569.       MyCaos.##r3        = (ULONG) v3;            \
  570.       MyCaos.##r4        = (ULONG) v4;            \
  571.       MyCaos.##r5        = (ULONG) v5;            \
  572.       MyCaos.a6        = (ULONG) bn;            \
  573.       MyCaos.M68kCacheMode    =    cm1;            \
  574.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  575.       {                                \
  576.         MyCaos.M68kStart    =    cs1;            \
  577.         MyCaos.M68kLength    =    cl1;            \
  578.       }                                \
  579.       MyCaos.PPCCacheMode    =    cm2;            \
  580.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  581.       {                                \
  582.         MyCaos.PPCStart    =    cs2;            \
  583.         MyCaos.PPCLength    =    cl2;            \
  584.       }                                \
  585.       MyCaos.caos_Un.Offset    =    (-offs);        \
  586.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  587.       _##name##_re;                        \
  588.    }                                \
  589. })
  590.  
  591. #define LP5NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  592. ({                                \
  593.    struct Caos MyCaos;                        \
  594.    {                                \
  595.       MyCaos.##r1        = (ULONG) v1;            \
  596.       MyCaos.##r2        = (ULONG) v2;            \
  597.       MyCaos.##r3        = (ULONG) v3;            \
  598.       MyCaos.##r4        = (ULONG) v4;            \
  599.       MyCaos.##r5        = (ULONG) v5;            \
  600.       MyCaos.a6        = (ULONG) bn;            \
  601.       MyCaos.M68kCacheMode    =    cm1;            \
  602.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  603.       {                                \
  604.         MyCaos.M68kStart    =    cs1;            \
  605.         MyCaos.M68kLength    =    cl1;            \
  606.       }                                \
  607.       MyCaos.PPCCacheMode    =    cm2;            \
  608.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  609.       {                                \
  610.         MyCaos.PPCStart    =    cs2;            \
  611.         MyCaos.PPCLength    =    cl2;            \
  612.       }                                \
  613.       MyCaos.caos_Un.Offset    =    (-offs);        \
  614.       PPCCallOS(&MyCaos);                    \
  615.    }                                \
  616. })
  617.  
  618. /* Only exec.library/MakeLibrary() */
  619. #define LP5FP(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, bt, bn, fpt, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  620. ({                                \
  621.    typedef fpt;                            \
  622.    struct Caos MyCaos;                        \
  623.    {                                \
  624.       rt _##name##_re;                        \
  625.       MyCaos.##r1        = (ULONG) v1;            \
  626.       MyCaos.##r2        = (ULONG) v2;            \
  627.       MyCaos.##r3        = (ULONG) v3;            \
  628.       MyCaos.##r4        = (ULONG) v4;            \
  629.       MyCaos.##r5        = (ULONG) v5;            \
  630.       MyCaos.a6        = (ULONG) bn;            \
  631.       MyCaos.M68kCacheMode    =    cm1;            \
  632.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  633.       {                                \
  634.         MyCaos.M68kStart    =    cs1;            \
  635.         MyCaos.M68kLength    =    cl1;            \
  636.       }                                \
  637.       MyCaos.PPCCacheMode    =    cm2;            \
  638.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  639.       {                                \
  640.         MyCaos.PPCStart    =    cs2;            \
  641.         MyCaos.PPCLength    =    cl2;            \
  642.       }                                \
  643.       MyCaos.caos_Un.Offset    =    (-offs);        \
  644.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  645.       _##name##_re;                        \
  646.    }                                \
  647. })
  648.  
  649. #define LP6(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  650. ({                                \
  651.    struct Caos MyCaos;                        \
  652.    {                                \
  653.       rt _##name##_re;                        \
  654.       MyCaos.##r1        = (ULONG) v1;            \
  655.       MyCaos.##r2        = (ULONG) v2;            \
  656.       MyCaos.##r3        = (ULONG) v3;            \
  657.       MyCaos.##r4        = (ULONG) v4;            \
  658.       MyCaos.##r5        = (ULONG) v5;            \
  659.       MyCaos.##r6        = (ULONG) v6;            \
  660.       MyCaos.a6        = (ULONG) bn;            \
  661.       MyCaos.M68kCacheMode    =    cm1;            \
  662.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  663.       {                                \
  664.         MyCaos.M68kStart    =    cs1;            \
  665.         MyCaos.M68kLength    =    cl1;            \
  666.       }                                \
  667.       MyCaos.PPCCacheMode    =    cm2;            \
  668.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  669.       {                                \
  670.         MyCaos.PPCStart    =    cs2;            \
  671.         MyCaos.PPCLength    =    cl2;            \
  672.       }                                \
  673.       MyCaos.caos_Un.Offset    =    (-offs);        \
  674.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  675.       _##name##_re;                        \
  676.    }                                \
  677. })
  678.  
  679. #define LP6NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  680. ({                                \
  681.    struct Caos MyCaos;                        \
  682.    {                                \
  683.       MyCaos.##r1        = (ULONG) v1;            \
  684.       MyCaos.##r2        = (ULONG) v2;            \
  685.       MyCaos.##r3        = (ULONG) v3;            \
  686.       MyCaos.##r4        = (ULONG) v4;            \
  687.       MyCaos.##r5        = (ULONG) v5;            \
  688.       MyCaos.##r6        = (ULONG) v6;            \
  689.       MyCaos.a6        = (ULONG) bn;            \
  690.       MyCaos.M68kCacheMode    =    cm1;            \
  691.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  692.       {                                \
  693.         MyCaos.M68kStart    =    cs1;            \
  694.         MyCaos.M68kLength    =    cl1;            \
  695.       }                                \
  696.       MyCaos.PPCCacheMode    =    cm2;            \
  697.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  698.       {                                \
  699.         MyCaos.PPCStart    =    cs2;            \
  700.         MyCaos.PPCLength    =    cl2;            \
  701.       }                                \
  702.       MyCaos.caos_Un.Offset    =    (-offs);        \
  703.       PPCCallOS(&MyCaos);                    \
  704.    }                                \
  705. })
  706.  
  707. #define LP7(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  708. ({                                \
  709.    struct Caos MyCaos;                        \
  710.    {                                \
  711.       rt _##name##_re;                        \
  712.       MyCaos.##r1        = (ULONG) v1;            \
  713.       MyCaos.##r2        = (ULONG) v2;            \
  714.       MyCaos.##r3        = (ULONG) v3;            \
  715.       MyCaos.##r4        = (ULONG) v4;            \
  716.       MyCaos.##r5        = (ULONG) v5;            \
  717.       MyCaos.##r6        = (ULONG) v6;            \
  718.       MyCaos.##r7        = (ULONG) v7;            \
  719.       MyCaos.a6        = (ULONG) bn;            \
  720.       MyCaos.M68kCacheMode    =    cm1;            \
  721.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  722.       {                                \
  723.         MyCaos.M68kStart    =    cs1;            \
  724.         MyCaos.M68kLength    =    cl1;            \
  725.       }                                \
  726.       MyCaos.PPCCacheMode    =    cm2;            \
  727.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  728.       {                                \
  729.         MyCaos.PPCStart    =    cs2;            \
  730.         MyCaos.PPCLength    =    cl2;            \
  731.       }                                \
  732.       MyCaos.caos_Un.Offset    =    (-offs);        \
  733.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  734.       _##name##_re;                        \
  735.    }                                \
  736. })
  737.  
  738. #define LP7NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  739. ({                                \
  740.    struct Caos MyCaos;                        \
  741.    {                                \
  742.       MyCaos.##r1        = (ULONG) v1;            \
  743.       MyCaos.##r2        = (ULONG) v2;            \
  744.       MyCaos.##r3        = (ULONG) v3;            \
  745.       MyCaos.##r4        = (ULONG) v4;            \
  746.       MyCaos.##r5        = (ULONG) v5;            \
  747.       MyCaos.##r6        = (ULONG) v6;            \
  748.       MyCaos.##r7        = (ULONG) v7;            \
  749.       MyCaos.a6        = (ULONG) bn;            \
  750.       MyCaos.M68kCacheMode    =    cm1;            \
  751.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  752.       {                                \
  753.         MyCaos.M68kStart    =    cs1;            \
  754.         MyCaos.M68kLength    =    cl1;            \
  755.       }                                \
  756.       MyCaos.PPCCacheMode    =    cm2;            \
  757.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  758.       {                                \
  759.         MyCaos.PPCStart    =    cs2;            \
  760.         MyCaos.PPCLength    =    cl2;            \
  761.       }                                \
  762.       MyCaos.caos_Un.Offset    =    (-offs);        \
  763.       PPCCallOS(&MyCaos);                    \
  764.    }                                \
  765. })
  766.  
  767. /* Only workbench.library/AddAppIconA() */
  768. #define LP7A4(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  769. ({                                \
  770.    struct Caos MyCaos;                        \
  771.    {                                \
  772.       rt _##name##_re;                        \
  773.       MyCaos.##r1        = (ULONG) v1;            \
  774.       MyCaos.##r2        = (ULONG) v2;            \
  775.       MyCaos.##r3        = (ULONG) v3;            \
  776.       MyCaos.##r4        = (ULONG) v4;            \
  777.       MyCaos.##r5        = (ULONG) v5;            \
  778.       MyCaos.##r6        = (ULONG) v6;            \
  779.       MyCaos.##r7        = (ULONG) v7;            \
  780.       MyCaos.a6        = (ULONG) bn;            \
  781.       MyCaos.M68kCacheMode    =    cm1;            \
  782.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  783.       {                                \
  784.         MyCaos.M68kStart    =    cs1;            \
  785.         MyCaos.M68kLength    =    cl1;            \
  786.       }                                \
  787.       MyCaos.PPCCacheMode    =    cm2;            \
  788.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  789.       {                                \
  790.         MyCaos.PPCStart    =    cs2;            \
  791.         MyCaos.PPCLength    =    cl2;            \
  792.       }                                \
  793.       MyCaos.caos_Un.Offset    =    (-offs);        \
  794.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  795.       _##name##_re;                        \
  796.    }                                \
  797. })
  798.  
  799. /* Would you believe that there really are beasts that need more than 7
  800.    arguments? :-) */
  801.  
  802. /* For example intuition.library/AutoRequest() */
  803. #define LP8(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  804. ({                                \
  805.    struct Caos MyCaos;                        \
  806.    {                                \
  807.       rt _##name##_re;                        \
  808.       MyCaos.##r1        = (ULONG) v1;            \
  809.       MyCaos.##r2        = (ULONG) v2;            \
  810.       MyCaos.##r3        = (ULONG) v3;            \
  811.       MyCaos.##r4        = (ULONG) v4;            \
  812.       MyCaos.##r5        = (ULONG) v5;            \
  813.       MyCaos.##r6        = (ULONG) v6;            \
  814.       MyCaos.##r7        = (ULONG) v7;            \
  815.       MyCaos.##r8        = (ULONG) v8;            \
  816.       MyCaos.a6        = (ULONG) bn;            \
  817.       MyCaos.M68kCacheMode    =    cm1;            \
  818.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  819.       {                                \
  820.         MyCaos.M68kStart    =    cs1;            \
  821.         MyCaos.M68kLength    =    cl1;            \
  822.       }                                \
  823.       MyCaos.PPCCacheMode    =    cm2;            \
  824.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  825.       {                                \
  826.         MyCaos.PPCStart    =    cs2;            \
  827.         MyCaos.PPCLength    =    cl2;            \
  828.       }                                \
  829.       MyCaos.caos_Un.Offset    =    (-offs);        \
  830.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  831.       _##name##_re;                        \
  832.    }                                \
  833. })
  834.  
  835. /* For example intuition.library/ModifyProp() */
  836. #define LP8NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  837. ({                                \
  838.    struct Caos MyCaos;                        \
  839.    {                                \
  840.       MyCaos.##r1        = (ULONG) v1;            \
  841.       MyCaos.##r2        = (ULONG) v2;            \
  842.       MyCaos.##r3        = (ULONG) v3;            \
  843.       MyCaos.##r4        = (ULONG) v4;            \
  844.       MyCaos.##r5        = (ULONG) v5;            \
  845.       MyCaos.##r6        = (ULONG) v6;            \
  846.       MyCaos.##r7        = (ULONG) v7;            \
  847.       MyCaos.##r8        = (ULONG) v8;            \
  848.       MyCaos.a6        = (ULONG) bn;            \
  849.       MyCaos.M68kCacheMode    =    cm1;            \
  850.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  851.       {                                \
  852.         MyCaos.M68kStart    =    cs1;            \
  853.         MyCaos.M68kLength    =    cl1;            \
  854.       }                                \
  855.       MyCaos.PPCCacheMode    =    cm2;            \
  856.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  857.       {                                \
  858.         MyCaos.PPCStart    =    cs2;            \
  859.         MyCaos.PPCLength    =    cl2;            \
  860.       }                                \
  861.       MyCaos.caos_Un.Offset    =    (-offs);        \
  862.       PPCCallOS(&MyCaos);                    \
  863.    }                                \
  864. })
  865.  
  866. /* For example layers.library/CreateUpfrontHookLayer() */
  867. #define LP9(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  868. ({                                \
  869.    struct Caos MyCaos;                        \
  870.    {                                \
  871.       rt _##name##_re;                        \
  872.       MyCaos.##r1        = (ULONG) v1;            \
  873.       MyCaos.##r2        = (ULONG) v2;            \
  874.       MyCaos.##r3        = (ULONG) v3;            \
  875.       MyCaos.##r4        = (ULONG) v4;            \
  876.       MyCaos.##r5        = (ULONG) v5;            \
  877.       MyCaos.##r6        = (ULONG) v6;            \
  878.       MyCaos.##r7        = (ULONG) v7;            \
  879.       MyCaos.##r8        = (ULONG) v8;            \
  880.       MyCaos.##r9        = (ULONG) v9;            \
  881.       MyCaos.a6        = (ULONG) bn;            \
  882.       MyCaos.M68kCacheMode    =    cm1;            \
  883.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  884.       {                                \
  885.         MyCaos.M68kStart    =    cs1;            \
  886.         MyCaos.M68kLength    =    cl1;            \
  887.       }                                \
  888.       MyCaos.PPCCacheMode    =    cm2;            \
  889.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  890.       {                                \
  891.         MyCaos.PPCStart    =    cs2;            \
  892.         MyCaos.PPCLength    =    cl2;            \
  893.       }                                \
  894.       MyCaos.caos_Un.Offset    =    (-offs);        \
  895.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  896.       _##name##_re;                        \
  897.    }                                \
  898. })
  899.  
  900. /* For example intuition.library/NewModifyProp() */
  901. #define LP9NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  902. ({                                \
  903.    struct Caos MyCaos;                        \
  904.    {                                \
  905.       MyCaos.##r1        = (ULONG) v1;            \
  906.       MyCaos.##r2        = (ULONG) v2;            \
  907.       MyCaos.##r3        = (ULONG) v3;            \
  908.       MyCaos.##r4        = (ULONG) v4;            \
  909.       MyCaos.##r5        = (ULONG) v5;            \
  910.       MyCaos.##r6        = (ULONG) v6;            \
  911.       MyCaos.##r7        = (ULONG) v7;            \
  912.       MyCaos.##r8        = (ULONG) v8;            \
  913.       MyCaos.##r9        = (ULONG) v9;            \
  914.       MyCaos.a6        = (ULONG) bn;            \
  915.       MyCaos.M68kCacheMode    =    cm1;            \
  916.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  917.       {                                \
  918.         MyCaos.M68kStart    =    cs1;            \
  919.         MyCaos.M68kLength    =    cl1;            \
  920.       }                                \
  921.       MyCaos.PPCCacheMode    =    cm2;            \
  922.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  923.       {                                \
  924.         MyCaos.PPCStart    =    cs2;            \
  925.         MyCaos.PPCLength    =    cl2;            \
  926.       }                                \
  927.       MyCaos.caos_Un.Offset    =    (-offs);        \
  928.       PPCCallOS(&MyCaos);                    \
  929.    }                                \
  930. })
  931.  
  932. /* LP10 not needed... */
  933. /* Kriton Kyrimis <kyrimis@cti.gr> says CyberGraphics needs the following */
  934. #define LP10(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, t10, v10, r10, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  935. ({                                \
  936.    struct Caos MyCaos;                        \
  937.    {                                \
  938.       rt _##name##_re;                        \
  939.       MyCaos.##r1        = (ULONG) v1;            \
  940.       MyCaos.##r2        = (ULONG) v2;            \
  941.       MyCaos.##r3        = (ULONG) v3;            \
  942.       MyCaos.##r4        = (ULONG) v4;            \
  943.       MyCaos.##r5        = (ULONG) v5;            \
  944.       MyCaos.##r6        = (ULONG) v6;            \
  945.       MyCaos.##r7        = (ULONG) v7;            \
  946.       MyCaos.##r8        = (ULONG) v8;            \
  947.       MyCaos.##r9        = (ULONG) v9;            \
  948.       MyCaos.##r10        = (ULONG) v10;            \
  949.       MyCaos.a6        = (ULONG) bn;            \
  950.       MyCaos.M68kCacheMode    =    cm1;            \
  951.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  952.       {                                \
  953.         MyCaos.M68kStart    =    cs1;            \
  954.         MyCaos.M68kLength    =    cl1;            \
  955.       }                                \
  956.       MyCaos.PPCCacheMode    =    cm2;            \
  957.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  958.       {                                \
  959.         MyCaos.PPCStart    =    cs2;            \
  960.         MyCaos.PPCLength    =    cl2;            \
  961.       }                                \
  962.       MyCaos.caos_Un.Offset    =    (-offs);        \
  963.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  964.       _##name##_re;                        \
  965.    }                                \
  966. })
  967.  
  968. /* Only graphics.library/BltMaskBitMapRastPort() */
  969. #define LP10NR(offs, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, t10, v10, r10, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  970. ({                                \
  971.    struct Caos MyCaos;                        \
  972.    {                                \
  973.       MyCaos.##r1        = (ULONG) v1;            \
  974.       MyCaos.##r2        = (ULONG) v2;            \
  975.       MyCaos.##r3        = (ULONG) v3;            \
  976.       MyCaos.##r4        = (ULONG) v4;            \
  977.       MyCaos.##r5        = (ULONG) v5;            \
  978.       MyCaos.##r6        = (ULONG) v6;            \
  979.       MyCaos.##r7        = (ULONG) v7;            \
  980.       MyCaos.##r8        = (ULONG) v8;            \
  981.       MyCaos.##r9        = (ULONG) v9;            \
  982.       MyCaos.##r10        = (ULONG) v10;            \
  983.       MyCaos.a6        = (ULONG) bn;            \
  984.       MyCaos.M68kCacheMode    =    cm1;            \
  985.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  986.       {                                \
  987.         MyCaos.M68kStart    =    cs1;            \
  988.         MyCaos.M68kLength    =    cl1;            \
  989.       }                                \
  990.       MyCaos.PPCCacheMode    =    cm2;            \
  991.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  992.       {                                \
  993.         MyCaos.PPCStart    =    cs2;            \
  994.         MyCaos.PPCLength    =    cl2;            \
  995.       }                                \
  996.       MyCaos.caos_Un.Offset    =    (-offs);        \
  997.       PPCCallOS(&MyCaos);                    \
  998.    }                                \
  999. })
  1000.  
  1001. /* Only graphics.library/BltBitMap() */
  1002. #define LP11(offs, rt, name, t1, v1, r1, t2, v2, r2, t3, v3, r3, t4, v4, r4, t5, v5, r5, t6, v6, r6, t7, v7, r7, t8, v8, r8, t9, v9, r9, t10, v10, r10, t11, v11, r11, bt, bn, cm1, cs1, cl1, cm2, cs2, cl2 )    \
  1003. ({                                \
  1004.    struct Caos MyCaos;                        \
  1005.    {                                \
  1006.       rt _##name##_re;                        \
  1007.       MyCaos.##r1        = (ULONG) v1;            \
  1008.       MyCaos.##r2        = (ULONG) v2;            \
  1009.       MyCaos.##r3        = (ULONG) v3;            \
  1010.       MyCaos.##r4        = (ULONG) v4;            \
  1011.       MyCaos.##r5        = (ULONG) v5;            \
  1012.       MyCaos.##r6        = (ULONG) v6;            \
  1013.       MyCaos.##r7        = (ULONG) v7;            \
  1014.       MyCaos.##r8        = (ULONG) v8;            \
  1015.       MyCaos.##r9        = (ULONG) v9;            \
  1016.       MyCaos.##r10        = (ULONG) v10;            \
  1017.       MyCaos.##r11        = (ULONG) v11;            \
  1018.       MyCaos.a6        = (ULONG) bn;            \
  1019.       MyCaos.M68kCacheMode    =    cm1;            \
  1020.       if ((cm1==IF_CACHEFLUSHAREA) || (cm1==IF_CACHEINVALIDAREA))    \
  1021.       {                                \
  1022.         MyCaos.M68kStart    =    cs1;            \
  1023.         MyCaos.M68kLength    =    cl1;            \
  1024.       }                                \
  1025.       MyCaos.PPCCacheMode    =    cm2;            \
  1026.       if ((cm2==IF_CACHEFLUSHAREA) || (cm2==IF_CACHEINVALIDAREA))    \
  1027.       {                                \
  1028.         MyCaos.PPCStart    =    cs2;            \
  1029.         MyCaos.PPCLength    =    cl2;            \
  1030.       }                                \
  1031.       MyCaos.caos_Un.Offset    =    (-offs);        \
  1032.       _##name##_re = (rt) PPCCallOS(&MyCaos);            \
  1033.       _##name##_re;                        \
  1034.    }                                \
  1035. })
  1036.  
  1037. #endif /* __INLINE_MACROS_H */
  1038.